package com.ruoyi.merchant.mapper;


import com.ruoyi.common.core.cg.pojo.Leader;
import com.ruoyi.common.core.cg.pojo.LeaderGroup;
import com.ruoyi.merchant.dto.UserDTO;
import org.apache.ibatis.annotations.*;

/**
* @author ？？？
* @description 针对表【leader】的数据库操作Mapper
* @createDate 2025-03-13 08:38:20
* @Entity com.zt.pojo.Leader
*/
@Mapper
public interface LeaderMapper {
    @Insert("insert into leader (invitation_code,name,phone,password,idcard,money,create_time)\n" +
            "values (#{invitationCode},#{name},#{phone},#{password},#{idcard},#{money},#{createTime})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int leaderSave(Leader leader);


    //leader和group的中间表
    @Insert("insert into t_leader_group (leader_id,group_id) values(#{leaderId},#{groupId})")
    int leaderGroupSave(LeaderGroup leaderGroup);

    //修改
    @Update("update leader set name=#{name},idcard=#{idcard},money=#{money},invitation_code=#{invitationCode},create_time=#{createTime} where id=#{id}")
    int updateLeader(Leader leader);

    //提交审核回显数据
    UserDTO selectById(Integer uid);

}




